//
//  XPCrashLogUtils.h
//  PywCommonSDKDemo
//
//  Created by Ampaw on 2018/4/16.
//  Copyright © 2018年 Ampaw. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface XPCrashLogUtils : NSObject

/**
 存储异常数据
 
 @param data 异常数据 {"time":urlencode(timestamp),"msg":urlencode(exceptionJsonString)}
 
 参数说明：
 timestamp是异常发生时间
 exceptionJsonString是异常信息JSON串
    如：{“ExceptionType”  :   "NSRangeException",
        "ExceptionReason":   "*** -[__NSSingleObjectArrayI objectAtIndex:]: index 1 beyond bounds [0 .. 0]"",
        "ExceptionInfo"  :   "{"XPUncaughtExceptionHandlerStackInfoKey": ["0 CoreFoundation 0x000000018117f17c <redacted> + 148"],
                               "XPUncaughtExceptionHandlerAppInfoKey"  : "Bundle ID:com.guibei.batianchuanqi  应用版本:6.0(1)  设备机型:iPhone  系统版本:11.2.6"
                              }"
        }
 */
+ (void)saveCrashLogWithJSONData:(NSDictionary *)data;

/**
 删除已上报数据
 */
+ (void)deleteCrashLog;

/**
 读取存储异常数据

 @return 异常数据数组
 */
+ (NSArray *)readCrashData;

@end
